import ConfigParser, os, sqlalchemy
import logging, logging.config

# A common metadata object that is shared amoung all components
sqlalchemy_meta_data = sqlalchemy.MetaData()

# A common configuration object
configdir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 
                                         '..', 'config'))
configfile = os.path.join(configdir, 'divirt.conf')
config = ConfigParser.ConfigParser()
config.read(configfile)

# Initialize the logger
logconfigfile = os.path.join(configdir, 'log.conf')
logging.config.fileConfig(logconfigfile)
